package com.mtbu.bean.base;
import java.util.*;
import java.text.SimpleDateFormat;
import org.json.JSONObject;
import my.json.core.JsonAble;
public abstract class BppInfoBase implements JsonAble {
    private Map<String, Object> dirtyProperties = new HashMap<String, Object>();
    //自增ID
    private int id = 0;
    //百科类型
    private int bkType = 0;
    //百科ID
    private int bkID = 0;
    //百科子ID（分集ID）
    private int subID = 0;
    //百科名称
    private String title = "";
    //更多中英文名称
    private String moreTitle = "";
    //英文名
    private String titleEn = "";
    //部/季
    private String season = "";
    //扩展名
    private String titleExtend = "";
    //年代
    private int years = 0;
    //封面图
    private String coverPic = "";
    //横图封面
    private String coverPicH = "";
    //导演
    private String directors = "";
    //演员
    private String actors = "";
    //原作者
    private String authors = "";
    //
    private String areas = "";
    //
    private String classes = "";
    //简介
    private String description = "";
    //来源，只有新闻才有
    private String source = "";
    //标签
    private String tag = "";
    //定期更新时间
    private String fixUpdate = "";
    //全集总数
    private int episode = 0;
    //上映日期
    private Date releaseDate = null;
    //
    private Date updateTime = null;
    public int getId(){
        return this.id;
    }
    public void setId(int id){
        this.id = id;
    }
    public int getBkType(){
        return this.bkType;
    }
    public void setBkType(int bkType){
        this.bkType = bkType;
        dirtyProperties.put("bkType", bkType);
    }
    public int getBkID(){
        return this.bkID;
    }
    public void setBkID(int bkID){
        this.bkID = bkID;
        dirtyProperties.put("bkID", bkID);
    }
    public int getSubID(){
        return this.subID;
    }
    public void setSubID(int subID){
        this.subID = subID;
        dirtyProperties.put("subID", subID);
    }
    public String getTitle(){
        return this.title;
    }
    public void setTitle(String title){
        this.title = title;
        dirtyProperties.put("title", title);
    }
    public String getMoreTitle(){
        return this.moreTitle;
    }
    public void setMoreTitle(String moreTitle){
        this.moreTitle = moreTitle;
        dirtyProperties.put("moreTitle", moreTitle);
    }
    public String getTitleEn(){
        return this.titleEn;
    }
    public void setTitleEn(String titleEn){
        this.titleEn = titleEn;
        dirtyProperties.put("titleEn", titleEn);
    }
    public String getSeason(){
        return this.season;
    }
    public void setSeason(String season){
        this.season = season;
        dirtyProperties.put("season", season);
    }
    public String getTitleExtend(){
        return this.titleExtend;
    }
    public void setTitleExtend(String titleExtend){
        this.titleExtend = titleExtend;
        dirtyProperties.put("titleExtend", titleExtend);
    }
    public int getYears(){
        return this.years;
    }
    public void setYears(int years){
        this.years = years;
        dirtyProperties.put("years", years);
    }
    public String getCoverPic(){
        return this.coverPic;
    }
    public void setCoverPic(String coverPic){
        this.coverPic = coverPic;
        dirtyProperties.put("coverPic", coverPic);
    }
    public String getCoverPicH(){
        return this.coverPicH;
    }
    public void setCoverPicH(String coverPicH){
        this.coverPicH = coverPicH;
        dirtyProperties.put("coverPicH", coverPicH);
    }
    public String getDirectors(){
        return this.directors;
    }
    public void setDirectors(String directors){
        this.directors = directors;
        dirtyProperties.put("directors", directors);
    }
    public String getActors(){
        return this.actors;
    }
    public void setActors(String actors){
        this.actors = actors;
        dirtyProperties.put("actors", actors);
    }
    public String getAuthors(){
        return this.authors;
    }
    public void setAuthors(String authors){
        this.authors = authors;
        dirtyProperties.put("authors", authors);
    }
    public String getAreas(){
        return this.areas;
    }
    public void setAreas(String areas){
        this.areas = areas;
        dirtyProperties.put("areas", areas);
    }
    public String getClasses(){
        return this.classes;
    }
    public void setClasses(String classes){
        this.classes = classes;
        dirtyProperties.put("classes", classes);
    }
    public String getDescription(){
        return this.description;
    }
    public void setDescription(String description){
        this.description = description;
        dirtyProperties.put("description", description);
    }
    public String getSource(){
        return this.source;
    }
    public void setSource(String source){
        this.source = source;
        dirtyProperties.put("source", source);
    }
    public String getTag(){
        return this.tag;
    }
    public void setTag(String tag){
        this.tag = tag;
        dirtyProperties.put("tag", tag);
    }
    public String getFixUpdate(){
        return this.fixUpdate;
    }
    public void setFixUpdate(String fixUpdate){
        this.fixUpdate = fixUpdate;
        dirtyProperties.put("fixUpdate", fixUpdate);
    }
    public int getEpisode(){
        return this.episode;
    }
    public void setEpisode(int episode){
        this.episode = episode;
        dirtyProperties.put("episode", episode);
    }
    public Date getReleaseDate(){
        return this.releaseDate;
    }
    public String getReleaseDate_ToDateString(){
        if(releaseDate==null) return "";
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        return formatter.format(this.releaseDate);
    }
    public String getReleaseDate_ToTimeString(){
        if(releaseDate==null) return "";
        SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
        return formatter.format(this.releaseDate);
    }
    public String getReleaseDate_ToDateTimeString(){
        if(releaseDate==null)   return "";
        SimpleDateFormat   formatter   =   new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return formatter.format(this.releaseDate);
    }
    public void setReleaseDate(Date releaseDate){
        this.releaseDate = releaseDate;
        dirtyProperties.put("releaseDate", releaseDate);
    }
    public Date getUpdateTime(){
        return this.updateTime;
    }
    public String getUpdateTime_ToDateString(){
        if(updateTime==null) return "";
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        return formatter.format(this.updateTime);
    }
    public String getUpdateTime_ToTimeString(){
        if(updateTime==null) return "";
        SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
        return formatter.format(this.updateTime);
    }
    public String getUpdateTime_ToDateTimeString(){
        if(updateTime==null)   return "";
        SimpleDateFormat   formatter   =   new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return formatter.format(this.updateTime);
    }
    public void setUpdateTime(Date updateTime){
        this.updateTime = updateTime;
        dirtyProperties.put("updateTime", updateTime);
    }
    public Map<String, Object> getDirtyProperties() {
        return this.dirtyProperties;
    }
    public JSONObject toJSON() throws Exception {
        JSONObject json = new JSONObject();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        json.put("id", this.getId());
        json.put("bkType", this.getBkType());
        json.put("bkID", this.getBkID());
        json.put("subID", this.getSubID());
        if(title!=null){
           json.put("title",this.getTitle());
        }
        if(moreTitle!=null){
           json.put("moreTitle",this.getMoreTitle());
        }
        if(titleEn!=null){
           json.put("titleEn",this.getTitleEn());
        }
        if(season!=null){
           json.put("season",this.getSeason());
        }
        if(titleExtend!=null){
           json.put("titleExtend",this.getTitleExtend());
        }
        json.put("years", this.getYears());
        if(coverPic!=null){
           json.put("coverPic",this.getCoverPic());
        }
        if(coverPicH!=null){
           json.put("coverPicH",this.getCoverPicH());
        }
        if(directors!=null){
           json.put("directors",this.getDirectors());
        }
        if(actors!=null){
           json.put("actors",this.getActors());
        }
        if(authors!=null){
           json.put("authors",this.getAuthors());
        }
        if(areas!=null){
           json.put("areas",this.getAreas());
        }
        if(classes!=null){
           json.put("classes",this.getClasses());
        }
        if(description!=null){
           json.put("description",this.getDescription());
        }
        if(source!=null){
           json.put("source",this.getSource());
        }
        if(tag!=null){
           json.put("tag",this.getTag());
        }
        if(fixUpdate!=null){
           json.put("fixUpdate",this.getFixUpdate());
        }
        json.put("episode", this.getEpisode());
        if(releaseDate!=null){
            json.put("releaseDate",formatter.format(this.getReleaseDate()));
        }
        if(updateTime!=null){
            json.put("updateTime",formatter.format(this.getUpdateTime()));
        }
        return json;
    }
    public void fromJSON(JSONObject json) throws Exception {
        if(json==null) return;
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try{
            if(json.get("id") != null){
                this.setId(Integer.parseInt(json.get("id")+""));
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("bkType") != null){
                this.setBkType(Integer.parseInt(json.get("bkType")+""));
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("bkID") != null){
                this.setBkID(Integer.parseInt(json.get("bkID")+""));
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("subID") != null){
                this.setSubID(Integer.parseInt(json.get("subID")+""));
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("title") != null){
                this.setTitle(json.get("title")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("moreTitle") != null){
                this.setMoreTitle(json.get("moreTitle")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("titleEn") != null){
                this.setTitleEn(json.get("titleEn")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("season") != null){
                this.setSeason(json.get("season")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("titleExtend") != null){
                this.setTitleExtend(json.get("titleExtend")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("years") != null){
                this.setYears(Integer.parseInt(json.get("years")+""));
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("coverPic") != null){
                this.setCoverPic(json.get("coverPic")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("coverPicH") != null){
                this.setCoverPicH(json.get("coverPicH")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("directors") != null){
                this.setDirectors(json.get("directors")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("actors") != null){
                this.setActors(json.get("actors")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("authors") != null){
                this.setAuthors(json.get("authors")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("areas") != null){
                this.setAreas(json.get("areas")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("classes") != null){
                this.setClasses(json.get("classes")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("description") != null){
                this.setDescription(json.get("description")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("source") != null){
                this.setSource(json.get("source")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("tag") != null){
                this.setTag(json.get("tag")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("fixUpdate") != null){
                this.setFixUpdate(json.get("fixUpdate")+"");
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("episode") != null){
                this.setEpisode(Integer.parseInt(json.get("episode")+""));
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("releaseDate") != null){
                this.setReleaseDate(formatter.parse(json.get("releaseDate")+""));
            }
        }catch(Exception ex){
        }
        try{
            if(json.get("updateTime") != null){
                this.setUpdateTime(formatter.parse(json.get("updateTime")+""));
            }
        }catch(Exception ex){
        }
    }
    public void fromMap(Map<String, String> json) throws Exception {
        if(json==null) return;
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            if(json.containsKey("id".toLowerCase())){
                this.setId(Integer.parseInt(json.get("id".toLowerCase())+""));
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("bkType".toLowerCase())){
                this.setBkType(Integer.parseInt(json.get("bkType".toLowerCase())+""));
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("bkID".toLowerCase())){
                this.setBkID(Integer.parseInt(json.get("bkID".toLowerCase())+""));
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("subID".toLowerCase())){
                this.setSubID(Integer.parseInt(json.get("subID".toLowerCase())+""));
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("title".toLowerCase())){
                this.setTitle(json.get("title".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("moreTitle".toLowerCase())){
                this.setMoreTitle(json.get("moreTitle".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("titleEn".toLowerCase())){
                this.setTitleEn(json.get("titleEn".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("season".toLowerCase())){
                this.setSeason(json.get("season".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("titleExtend".toLowerCase())){
                this.setTitleExtend(json.get("titleExtend".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("years".toLowerCase())){
                this.setYears(Integer.parseInt(json.get("years".toLowerCase())+""));
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("coverPic".toLowerCase())){
                this.setCoverPic(json.get("coverPic".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("coverPicH".toLowerCase())){
                this.setCoverPicH(json.get("coverPicH".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("directors".toLowerCase())){
                this.setDirectors(json.get("directors".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("actors".toLowerCase())){
                this.setActors(json.get("actors".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("authors".toLowerCase())){
                this.setAuthors(json.get("authors".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("areas".toLowerCase())){
                this.setAreas(json.get("areas".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("classes".toLowerCase())){
                this.setClasses(json.get("classes".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("description".toLowerCase())){
                this.setDescription(json.get("description".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("source".toLowerCase())){
                this.setSource(json.get("source".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("tag".toLowerCase())){
                this.setTag(json.get("tag".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("fixUpdate".toLowerCase())){
                this.setFixUpdate(json.get("fixUpdate".toLowerCase())+"");
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("episode".toLowerCase())){
                this.setEpisode(Integer.parseInt(json.get("episode".toLowerCase())+""));
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("releaseDate".toLowerCase())){
                this.setReleaseDate(formatter.parse(json.get("releaseDate".toLowerCase())+""));
            }
        }catch(Exception ex){
        }
        try {
            if(json.containsKey("updateTime".toLowerCase())){
                this.setUpdateTime(formatter.parse(json.get("updateTime".toLowerCase())+""));
            }
        }catch(Exception ex){
        }
    }
}
